const path = require("path");
const env = process.env.NODE_ENV || "company"; // 默认 company
require("dotenv").config({ path: path.resolve(__dirname, `../.env.${env}`) });
require("@/utils/other.js"); //导入其他与express服务无关联模块
const express = require("express"); //导入express框架
const apply = express(); //创建应用实例
const useMiddleware = require("@/utils/useMiddleware.js"); //导入全部中间件模块
useMiddleware(apply);
apply.listen(process.env.SERVICE_PORT, () => {
  console.log(
    `本地${process.env.SERVICE_PORT}端口服务已开启:http://localhost:${process.env.SERVICE_PORT}---${process.env.NODE_ENV}`
  );
});
